home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODFDev / ODF / OS / FWGraphx / FWRRcShp.h < prev    next >
Encoding:
Text File  |  1996-09-17  |  3.1 KB  |  108 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWRRcShp.h
  4. //    Release Version:    $ ODF 2 $
  5. //
  6. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef FWRRCSHP_H
  11. #define FWRRCSHP_H
  12.  
  13. #ifndef FWSHAPE_H
  14. #include "FWShape.h"
  15. #endif
  16.  
  17. #ifndef FWBNDSHP_H
  18. #include "FWBndShp.h"
  19. #endif
  20.  
  21. //========================================================================================
  22. //    Forward Declarations
  23. //========================================================================================
  24.  
  25. class FW_CGraphicContext;
  26.  
  27. //========================================================================================
  28. //    class FW_CRoundRectShape
  29. //========================================================================================
  30.  
  31. class FW_CRoundRectShape : public FW_CBoundedShape
  32. {
  33. public:
  34.     FW_DECLARE_CLASS
  35.     FW_DECLARE_AUTO(FW_CRoundRectShape)
  36.  
  37. //----------------------------------------------------------------------------------------
  38. //    Constructors/Destructors
  39. //
  40. public:
  41.     FW_CRoundRectShape(const FW_CRect& rect,
  42.                       const FW_CPoint& ovalSize,
  43.                       FW_ERenderVerbs renderVerb,
  44.                       const FW_CInk& ink = FW_kNormalInk,
  45.                       const FW_CStyle& style = FW_kNormalStyle);
  46.  
  47.     FW_CRoundRectShape(const FW_CRoundRectShape& other);
  48.     FW_CRoundRectShape(FW_CReadableStream& stream);
  49.     
  50.     virtual ~ FW_CRoundRectShape();
  51.     
  52. //----------------------------------------------------------------------------------------
  53. //    Operators
  54. //
  55. public:
  56.     FW_CRoundRectShape& operator=(const FW_CRoundRectShape& other);
  57.     
  58. //----------------------------------------------------------------------------------------
  59. //    Inherited API
  60. //
  61. public:
  62.     // ----- Hit Testing -----
  63.     virtual FW_Boolean         HitTest(FW_CGraphicContext& gc,
  64.                                         const FW_CPoint& test,
  65.                                         FW_Fixed tolerance) const;
  66.  
  67.     // ----- Copying -----
  68.     virtual FW_CShape*            Copy() const;
  69.     
  70.     // ----- Rendering -----
  71.     virtual void                 Render(FW_CGraphicContext& gc) const;
  72.  
  73.     // ----- Flatten -----
  74.     virtual void                Flatten(FW_CWritableStream& stream) const;
  75.  
  76. //----------------------------------------------------------------------------------------
  77. //    New API
  78. //
  79. public:
  80.     // ----- Rendering -----
  81.     static void                RenderRoundRect(FW_CGraphicContext& gc,
  82.                                                 const FW_CRect& rect, 
  83.                                                 const FW_CPoint& ovalSize,
  84.                                                 FW_ERenderVerbs renderVerb, 
  85.                                                 const FW_CInk& ink = FW_kNormalInk,
  86.                                                 const FW_CStyle& style = FW_kNormalStyle);
  87.  
  88.     // ----- Archiving -----
  89.     static void*                 Read(FW_CReadableStream& stream, FW_ClassTypeConstant type);
  90.  
  91.     // ----- Geometry -----
  92.     void                        SetGeometry(const FW_CRect& rect, const FW_CPoint& ovalSize);
  93.     void                         GetGeometry(FW_CRect& rect, FW_CPoint& ovalSize) const;
  94.  
  95.     FW_CPoint                    GetOvalSize() const
  96.                                     {return fOvalSize;}    
  97.     void                        SetOvalSize(const FW_CPoint& ovalSize)
  98.                                     {fOvalSize = ovalSize;}
  99.  
  100. //----------------------------------------------------------------------------------------
  101. //    Data Members
  102. //
  103. private:
  104.     FW_CPoint                    fOvalSize;
  105. };
  106.  
  107. #endif
  108.